<?php
    class StudentDormitoryExchangeBLL{
        //获取学生列表
        public function getStudentList($instructorID,$grade,$major,$class,$search,$page,$pageSize){
            $sde=new StudentDormitoryExchangeDAL();
            $result=$sde->getStudentList($grade,$major,$class,$search,$page*$pageSize,$pageSize);
            $result['page']=$this->getStudentListPage($result['count'],$pageSize);
            return $result;
        }

        //获取学生列表页数
        public function getStudentListPage($count,$pageSize){
            $pageMax=0;
            if($count>$pageSize){
                if($count%$pageSize===0){
                    $pageMax=(int)($count/$pageSize);
                }else{
                    $pageMax=(int)($count/$pageSize)+1;
                }
            }
            
            return $pageMax;
        }

        public function getInstructorAllocateList($instructorID){
            $PublicDataDAL=new PublicDataDAL();
            $result=$PublicDataDAL->getInstructorAllocateList($instructorID);
            return $result;
        }
    }
?>